package json;

import java.util.Date;
import java.util.HashMap;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 留言实体模型
 * 
 * @author:杭永昌
 * @CreateTime:2011-08-24
 */

public class Json_Message implements Parcelable {

	public HashMap<String, Object> map = new HashMap<String, Object>();

	@SuppressWarnings("unused")
	private static final long serialVersionUID = 8238307950011782546L;

	public Json_Message() {
	}

	private Long siteid;
	private Long senderuaid;
	private String senderuaname;
	private String content;
	private int state;
	private Date createtime;
	private String createip;
	private Long uaid;
	private String uaname;
	private Long messageid;
	private int score;
	private String replycontent;
	private Date replytime;
	private String replyip;
	private long companyid;// 站点ID

	public Long getCompanyId() {
		return companyid;
	}

	public void setCompanyId(Long companyid) {
		this.companyid = companyid;
	}

	/**
	 * 站点ID
	 */
	public Long getSiteid() {
		return siteid;
	}

	/**
	 * @param 站点ID
	 */
	public void setSiteid(Long siteid) {
		this.siteid = siteid;
	}

	/**
	 * @return 留言人ID
	 */
	public Long getSenderuaid() {
		return senderuaid;
	}

	/**
	 * @param 留言人ID
	 */
	public void setSenderuaid(Long senderuaid) {
		this.senderuaid = senderuaid;
	}

	/**
	 * @return 留言人 姓名
	 */
	public String getSenderuaname() {
		return senderuaname;
	}

	/**
	 * @param 留言人
	 *            姓名
	 */
	public void setSenderuaname(String senderuaname) {
		this.senderuaname = senderuaname;
	}

	/**
	 * @return 留言内容
	 */
	public String getContent() {
		return content;
	}

	/**
	 * @param 留言内容
	 */
	public void setContent(String content) {
		this.content = content;
	}

	/**
	 * @return 留言状态
	 */
	public int getState() {
		return state;
	}

	/**
	 * @param 留言状态
	 */
	public void setState(int state) {
		this.state = state;
	}

	/**
	 * @return 留言时间
	 */
	public Date getCreatetime() {
		return createtime;
	}

	/**
	 * @param 留言时间
	 */
	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	/**
	 * @return 留言人IP
	 */
	public String getCreateip() {
		return createip;
	}

	/**
	 * @param 留言人IP
	 */
	public void setCreateip(String createip) {
		this.createip = createip;
	}

	/**
	 * @return 网站所有人ID
	 */
	public Long getUaid() {
		return uaid;
	}

	/**
	 * @param 网站所有人ID
	 */
	public void setUaid(Long uaid) {
		this.uaid = uaid;
	}

	/**
	 * @return 网站所有人姓名
	 */
	public String getUaname() {
		return uaname;
	}

	/**
	 * @param 网站所有人姓名
	 */
	public void setUaname(String uaname) {
		this.uaname = uaname;
	}

	public Long getMessageid() {
		return messageid;
	}

	/**
	 * @param 编码
	 */
	public void setMessageid(Long messageid) {
		this.messageid = messageid;
	}

	/**
	 * @return 评分
	 */
	public int getScore() {
		return score;
	}

	/**
	 * @param 评分
	 */
	public void setScore(int score) {
		this.score = score;
	}

	/**
	 * @return 回复内容
	 */
	public String getReplycontent() {
		return replycontent;
	}

	/**
	 * @param 回复内容
	 */
	public void setReplycontent(String replycontent) {
		this.replycontent = replycontent;
	}

	/**
	 * @return 回复时间
	 */
	public Date getReplytime() {
		return replytime;
	}

	/**
	 * @param 回复时间
	 */
	public void setReplytime(Date replytime) {
		this.replytime = replytime;
	}

	/**
	 * @return 回复IP
	 */
	public String getReplyip() {
		return replyip;
	}

	/**
	 * @param 回复IP
	 */
	public void setReplyip(String replyip) {
		this.replyip = replyip;
	}

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		// TODO Auto-generated method stub
		dest.writeMap(map);
		dest.writeString(content);
		dest.writeString(uaname);
		dest.writeLong(messageid);
	}

	public static final Parcelable.Creator<Json_Message> CREATOR = new Parcelable.Creator<Json_Message>() {
		// 重写Creator

		@SuppressWarnings("unchecked")
		@Override
		public Json_Message createFromParcel(Parcel source) {
			Json_Message p = new Json_Message();
			p.map = source.readHashMap(HashMap.class.getClassLoader());
			p.setMessageid(source.readLong());
			p.setUaname(source.readString());
			p.setContent(source.readString());
			return p;
		}

		@Override
		public Json_Message[] newArray(int size) {
			// TODO Auto-generated method stub
			return null;
		}
	};

}
